package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.ReportGenerationLogMapper;
import com.hello.system.domain.ReportGenerationLog;
import com.hello.system.service.IReportGenerationLogService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 报生成记录Service业务层处理
 * 
 * @author hello
 * @date 2025-09-09
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class ReportGenerationLogServiceImpl extends ServiceImpl<ReportGenerationLogMapper, ReportGenerationLog> implements IReportGenerationLogService 
{
    private final ReportGenerationLogMapper reportGenerationLogMapper;

    /**
     * 查询报生成记录
     * 
     * @param generationId 报生成记录主键
     * @return 报生成记录
     */
    @Override
    public ReportGenerationLog selectReportGenerationLogByGenerationId(Long generationId)
    {
        return reportGenerationLogMapper.selectReportGenerationLogByGenerationId(generationId);
    }

    /**
     * 查询报生成记录列表
     * 
     * @param reportGenerationLog 报生成记录
     * @return 报生成记录
     */
    @Override
    public List<ReportGenerationLog> selectReportGenerationLogList(ReportGenerationLog reportGenerationLog)
    {
        return reportGenerationLogMapper.selectReportGenerationLogList(reportGenerationLog);
    }

    /**
     * 新增报生成记录
     * 
     * @param reportGenerationLog 报生成记录
     * @return 结果
     */
    @Override
    public int insertReportGenerationLog(ReportGenerationLog reportGenerationLog)
    {
        reportGenerationLog.setCreateTime(DateUtils.getNowDate());
        return reportGenerationLogMapper.insertReportGenerationLog(reportGenerationLog);
    }

    /**
     * 修改报生成记录
     * 
     * @param reportGenerationLog 报生成记录
     * @return 结果
     */
    @Override
    public int updateReportGenerationLog(ReportGenerationLog reportGenerationLog)
    {
        reportGenerationLog.setUpdateTime(DateUtils.getNowDate());
        return reportGenerationLogMapper.updateReportGenerationLog(reportGenerationLog);
    }


    /**
     * 批量删除报生成记录
     * 
     * @param generationIds 需要删除的报生成记录主键
     * @return 结果
     */
    @Override
    public int deleteReportGenerationLogByGenerationIds(Long[] generationIds)
    {
        return reportGenerationLogMapper.deleteReportGenerationLogByGenerationIds(generationIds);
    }

    /**
     * 删除报生成记录信息
     * 
     * @param generationId 报生成记录主键
     * @return 结果
     */
    @Override
    public int deleteReportGenerationLogByGenerationId(Long generationId)
    {
        return reportGenerationLogMapper.deleteReportGenerationLogByGenerationId(generationId);
    }
}
